package com.yuanqi.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanqi.Common.Pojo.Vo.PostVo;
import com.yuanqi.Common.Pojo.Vo.TopicVo;
import com.yuanqi.Common.Pojo.entity.Topic;
import com.yuanqi.Common.Pojo.entity.TopicClass;
import com.yuanqi.Common.Pojo.entity.TopicPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TopicMapper extends BaseMapper<Topic> {

    @Select("select id, classname from topic_class where status =  1")
    List<TopicClass> getlist();

    @Select("select post_id from topic_post where topic_id = #{topicId} limit #{start},3 ")
    List<Long> getPostIdList(Integer topicId,Integer start);

    @Select("select * from topic_post where topic_id = #{id}")
    List<TopicPost> selectPostCount(Integer id);

    List<TopicVo> selectHotTopicList(Integer start,Long time);

    List<PostVo> getPostListByTopicId(Integer topicId, Integer start, Boolean isTime);
}
